Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce hierarchical namespaces into SqlCatalog #591

Merged
merged 2 commits into from
May 28, 2024

Conversation

cccs-eric
Copy link
Contributor

@cccs-eric cccs-eric commented Apr 8, 2024

When comparing the Python implementation of SqlCatalog with the Java implementation (JdbcCatalog), I have noticed some differences that this PR tries to address. In my opinion, we should be able to read from the same catalog database, using both the Java or Python implementations with no impact.

Here is a list of changes proposed by this PR:

  • The Java implementation supports hierarchical namespaces, or multi-level namespaces separated by .. For example, ns1.ns2.ns3 is a valid namespace in Java, but not with the current Python implementation. Identifiers will now have an optional catalog_name, zero or more namespaces and a table_name. For example, an identifier for table catalog_name.ns1.ns2.ns3.table_name will be represented as the following tuple: ("catalog_name", "ns1", "ns2", "ns3", "table_name")
  • create_table(), register_table() now supports a table identifier with an optional catalog name.
  • References to database_name have been generalized by namespaces.
  • Fix a bug in list CLI command
  • Adds new and extends many unit tests to run against hierarchical namespaces.

Here is a list of things to do before opening PR:

  • Validate that the list CLI command fix is good
  • Should we allow table identifiers to have no namespace at all, like we do in Java? (pending @Fokko ) No.

@Fokko
Copy link
Contributor

Fokko commented Apr 25, 2024

Should we allow table identifiers to have no namespace at all, like we do in Java? (pending @Fokko )

No, I don't think we should allow this. We also disallow this for the REST catalog.

@Fokko Fokko self-requested a review April 25, 2024 07:45
@Fokko
Copy link
Contributor

Fokko commented May 15, 2024

@cccs-eric Thanks for working on this, could you resolve the conflicts and fix the tests? Sorry for the late reply, I was traveling last week and also the Iceberg summit took some attention :) Thanks!

@cccs-eric
Copy link
Contributor Author

@cccs-eric Thanks for working on this, could you resolve the conflicts and fix the tests? Sorry for the late reply, I was traveling last week and also the Iceberg summit took some attention :) Thanks!

@Fokko I have been the one delaying this work, I was swamped with other things. It has always been on my to-do list and I now have some time that I can devote. Hopefully it will be enough to carry the football past the goal line.

@cccs-eric cccs-eric force-pushed the sql_list_namespace_fix branch from c6b5177 to 744c742 Compare May 15, 2024 17:52
@cccs-eric cccs-eric marked this pull request as ready for review May 15, 2024 18:42
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thanks @cccs-eric for working on this 🙌

@Fokko Fokko merged commit 756ae62 into apache:main May 28, 2024
7 checks passed
@cccs-eric cccs-eric deleted the sql_list_namespace_fix branch May 28, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants